package com.heima.search.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.search.dto.ApArticleSearchDto;
import com.heima.search.service.IArticleSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/article/search")
public class ArticleSearchController {


    @Autowired
    IArticleSearchService articleSearchService; // 用户搜索微服务

    /**
     * 用户搜索功能, 列表查询
     * @param dto
     * @return
     */
    @PostMapping("/search")
    public ResponseResult search(@RequestBody ApArticleSearchDto dto){
        // 用户搜索微服务 完成用户搜索功能, 直接返回
        return articleSearchService.search(dto);
    }
}
